package com.qf.coupon.rule.impl;

import com.qf.coupon.rule.IRule;

import java.math.BigDecimal;

public class ManJianRule implements IRule {

    //满
    private double must;
    //减
    private double jian;


    @Override
    public boolean canUser(double money) {
        return money >= must;
    }

    @Override
    public double youhui(double money) {
        return BigDecimal.valueOf(money).subtract(BigDecimal.valueOf(jian)).doubleValue();
    }
}
